home *** CD-ROM | disk | FTP | other *** search
- '
- ' Quickbasic 4.0 "Auto-Compiler" version 1.0
- ' by Jeff Goza (c) 1988
- ' Non-commercial use only
- '
- ' This is a "simple" program that is run under QB 4.0 that will compile
- ' any Quickbasic programs found in the current directory. Before this
- ' is run you will need to make sure that all of the programs have been
- ' save in the Quickbasic TEXT format (pure ascii). Also any libraries
- ' (including the qb support libraries) MUST be located in the compile
- ' directory. After the program finishes it will erase all of the .obj
- ' files that are created.
- '
- ' Before running, make sure your PATH command knows where the QB files
- ' BC and Link are located. Also, since the program uses "SHELL" make sure
- ' it can find command.com. Another, obvious, note is that all of the
- ' include files your program uses must be in the current directory as well.
- '
- ' This program was originally written to help me on a _LARGE_ project
- ' to simplify the process of recompiling all of the source code. I am
- ' supplying it in source code, rather than .exe, so you can modify
- ' it for your needs.
- '
- ' Im not going to give the traditional "if you find this program useful
- ' send me XXX dollars" speech. But, since I am not adverse to money, Ill
- ' give my address and if the urge strikes you can send me some. I would also
- ' like to hear from others who program in Quickbasic. I do vertial market
- ' programming and would like to talk (write) to others who do that as well.
- '
- ' Comments, suggestions, money to:
- '
- ' Jeff Goza
- ' PO Box 6401
- ' Abilene, Tx 79608
- '
- ' CServe : 75056,3555
- ' Genie : J.Goza (or maybe JGoza, i forget)
- '
- ' p.s. This program is called COMPILE.ATO instead of COMPILE.BAS so
- ' it is not compiled each time it is run. Load it with LOAD
- ' compile.ato
- '
- '
-
- a$ = "" 'clear keyboard
- CLS : DIM arr$(70), li$(26) '70 files max (modify as needed)
- PRINT "Building Directory..."
-
- start$ = TIME$ 'get time started
-
- OPEN "error.lst" FOR OUTPUT AS #5: CLOSE #5 'error file
- SHELL "dir *.bas > dir.lst" 'read current directory
-
- OPEN "dir.lst" FOR INPUT AS #1
- FOR x = 1 TO 4: INPUT #1, a$: NEXT x 'throw out first 4 lines
-
- x = 0
- WHILE NOT EOF(1)
- INPUT #1, a$ 'read the directory into an array
- IF MID$(a$, 10, 3) = "BAS" THEN x = x + 1: arr$(x) = LEFT$(a$, 8) 'get only .bas files
- WEND
-
- FOR y = 1 TO x 'do all basic files
-
- CLS
- LOCATE 1, 1: PRINT "Working on file "; y; " of "; x; 'show were its at
- fil$ = LEFT$(arr$(y), 8): fil$ = LTRIM$(RTRIM$(fil$)) 'get file name ready
- LOCATE 2, 1: PRINT "File Name : "; fil$ 'show current file being done
-
- s1$ = "BC " + fil$ + "/X;"
-
- ' mofidy the BC statement as needed to include whatever switches your
- ' program requires.
-
- s2$ = "LINK /ex /noe /seg:256 " + fil$ + "+MYLIBRARY.lib," + fil$ + ".exe,nul;"
-
- ' modify the link statement as needed. you can insert the name of your
- ' library in the MYLIBRARY location. If you are not using a library
- ' you can remove it completly.
-
- SHELL s1$ 'execute BC
-
- '
- '
- ' -- Check for errors --------------------------------------------------------
- ' Severe Errors only, warning errors not reported.
- '
-
- FOR y% = 1 TO 24
- FOR zz% = 1 TO 80
- li$(y%) = li$(y%) + CHR$(SCREEN(y%, zz%))
- NEXT zz%
- NEXT y%
-
- FOR y% = 1 TO 24
- sev = INSTR(li$(y%), "Sev")
- IF sev > 0 THEN
- howmanysev = SCREEN(y%, sev - 2)
- hms$ = CHR$(howmanysev)
- hms = VAL(hms$)
- IF hms > 0 THEN
- OPEN "error.lst" FOR APPEND AS #5
- PRINT #5, "Severe Error(s) in "; arr$(y); " Did not compile succesfully!"
- CLOSE #5
- END IF
- END IF
- NEXT y%
-
- ' -- End of Check for Errors -------------------------------------------------
-
- SHELL s2$ 'execute link
-
- a$ = INKEY$: IF a$ = "@" THEN END 'press "@" to abort program
-
- FOR y% = 1 TO 24: li$(y%) = "": NEXT y% 'clear screen array
- NEXT y 'do next file
-
- KILL "*.obj" 'kill all .obj files
-
- FOR z% = 1 TO 10: SOUND 100 + z%, z%: NEXT z% 'im done, say so
-
- PRINT
- PRINT
- PRINT "Start Time : "; start$ 'show how long the compile/
- PRINT "End Time : "; TIME$ 'link process took
- PRINT
-
- END 'end it
-
-